//@ sourceURL=WorkMainView.js
Ext.ns("WorkMainView");
WorkMainView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        WorkMainView.superclass.constructor.call(this, {
            id : "WorkMainView",
            title : "工作要点管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
        var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'WorkMainForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "规划名称"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_planName_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "工作要点列表",
                rowActions:true,
                listUrl : __ctxPath + "/saferesponsibility/listWorkMain.do",
                removeUrl : __ctxPath + "/saferesponsibility/deleteWorkMain.do",
                fields : [ "id", 'years', 'institution', "planName", "planLevel", "planType", "planContent", "uploadDate"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                  //  width : 40,
                  //  sortable : true,
                    hidden : true
                }, {
                    header : "所属机构",
                    dataIndex : "institution",
                    width : 70
                }, {
                    header : "规划名称",
                    dataIndex : "planName",
                    width : 70
                }, {
                    header : "规划等级",
                    dataIndex : "planLevel",
                    width : 70,
                    renderer : function(j,i,g,m,h){
                        if(j==1){
                            return "班组级";
                        }else if(j==2){
                            return "部门级";
                        }else if(j==3){
                            return "企业级";
                        }
                    }
                },{
                    header : "规划类别",
                    dataIndex : "planType",
                    width : 70,
                    renderer : function(j,i,g,m,h){
                        if(j==1){
                            return "生产计划";
                        }else if(j==2){
                            return "劳动工资计划";
                        }else if(j==3){
                            return "财务计划";
                        }else if(j==4){
                            return "技术组织措施计划";
                        }else if(j==5){
                            return "其他计划";
                        }
                    }
                }, {
                    header : "规划内容",
                    dataIndex : "planContent",
                    width : 70
                   
                }, {
                    header : "上传时间",
                    dataIndex : "uploadDate",
                    width : 50
                } ]
            },
            tree : {
                treeUrl : __ctxPath + "/saferesponsibility/treeLoadWorkMain.do"
            }
            
        });
        return yearGridComponents;
    }
});